package com.heaton.videocar.ui

import android.app.AlertDialog
import android.content.DialogInterface
import android.util.Log
import com.heaton.baselib.base.BaseActivity
import com.heaton.baselib.utils.DialogUtils
import com.heaton.videocar.R
import kotlinx.android.synthetic.main.layout_fuction.*

class MainActivity: BaseActivity() {
    override fun layoutId() = R.layout.activity_main

    override fun bindData() {

    }

    override fun bindListener() {
        tv_settings.setOnClickListener { toActivity(SettingsActivity::class.java) }
        tv_screenshot.setOnClickListener {}
        tv_defect.setOnClickListener {
            showDefectDialog()
        }

        tv_input.setOnClickListener {toActivity(InputActivity::class.java)}
        tv_recorde.setOnClickListener {}
        tv_file.setOnClickListener {}
        tv_wheelsize.setOnClickListener {

        }
        tv_close.setOnClickListener {
            "ffmpeg -i rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mov -vf drawtext=\"expansion=strftime:basetime=\$(date +%s -d '2018-10-13 14:10:50'):fontfile=arial.ttf:x=w-tw:fontcolor=red:fontsize=30:text='%Y-%m-%d  %H\\\\:%M\\\\: %S\"  123.mp4\n"
            "-i /home/liujie/视频/屏幕录像 2022-01-09 19:55:34.mp4 -vf drawtext=\"expansion=strftime:basetime=\$(date +%s -d '2018-10-13 14:10:50'):fontfile=arial.ttf:x=w-tw:fontcolor=red:fontsize=30:text='%Y-%m-%d  %H\\\\:%M\\\\: %S\"  1.mp4"
        }

    }

    private fun showDefectDialog() {
        AlertDialog.Builder(this)
            .setTitle("选择类别")
            .setItems(arrayOf("新增缺陷","修改缺陷")) { dialog, which ->
                Log.e(TAG, "showDefectDialog: $which")
            }
            .show()
    }


}